Programmable controller including intelligent module

ABSTRACT

A programmable controller (PLC) facilitates modifications to programs running thereon, readily accommodates addition and removal of intelligent modules contained therein, and offers good maintenanceability. For modifying programs in a conventional PLC which incorporates intelligent modules, programs in each of the intelligent modules must be modified since programs are individually inputted to the respective intelligent modules, thus giving rise to a problem in that an increased amount of works are required. In the PLC of the present invention, a processing unit of an intelligent module is configured equivalent to a processing unit of a CPU module, and registers and memories of respective intelligent modules are allocated in a memory map of the CPU module to build a hardware configuration which allows the processing unit of the CPU module to read and write the registers and memories of the respective intelligent modules, so that the intelligent modules can be controlled in a manner similar to the CPU module. Software running on the CPU module is additionally provided with instructions which indicate that they are executed in an intelligent module but can be processed either by the CPU module or by the intelligent module.

BACKGROUND OF THE INVENTION

The present invention relates generally to a programmable controller(hereinafter abbreviated as the “PLC”) which is configured such thatintelligent modules can be connected thereto, and more particularly tothe processing of user programs for a CPU module and such intelligentmodules.

A prior art PLC will be first described with reference to FIG. 2.Generally, the PLC is programmed by the user using an appropriateperipheral device such that the PLC performs operations desired by theuser. A program for use with the PLC is transferred to a CPU module 1through a peripheral device connected thereto, and stored in a usermemory 3 within the CPU module 1 or in a memory of a separate storagemodule. This program is executed by a processing unit 2 in the CPUmodule 1.

An intelligent module 5 may be incorporated in the PLC when it isdesired to realize a control which exhibits superior responseperformance. This module has a unique program system and thereforeoperates independently of programs stored in the CPU module 1. For thisreason, the intelligent module 5 only communicates data with the CPUmodule 1 through a system bus 9 and a PI/O bus 9′. As illustrated inFIG. 2, assume that a switch is turned on in a user program stored inthe user memory 3 to start a device connected thereto, causing a program13 to start running on the intelligent module 5 (a starting condition10). Since this program 13 is stored only in a processing memory 7 ofthe intelligent module 5, the program 13 is not executed when theintelligent module 5 is not mounted in the PLC. For processing theprogram 13 even when the intelligent module 5 is not mounted in the samemanner as when it is mounted, a modification is required to the userprogram in the CPU module 1 to add the contents of the program 13 to theuser program.

The programming of the intelligent module 5 involves creating a programin a peripheral device, connecting the peripheral device to theintelligent module 5 to transfer the program thereto, and storing theprogram in the processing memory 7 within the intelligent module 5, asis the case of the programming of the CPU module 1. Thus, when theintelligent module 5 is used as a component forming part of the PLC, theuser is required to create a program for the intelligent module 5separately from a user program stored in the CPU module 1, and to storethe created program in the processing memory 7 within the intelligentmodule 5.

When the intelligent module or modules 5 are added to the PLC with anintention of realizing a control which exhibits superior responseperformance, settings and operation contents are described individuallyin each intelligent modules as does the prior art example. As a largernumber of intelligent modules are mounted in the PLC, more complicatedworks are required for changes and modifications.

Specifically, since a program for use in the intelligent program 5 isindependent of a program for use in the CPU module 1, respectiveprograms must be installed individually into associated modules, and anymodification to a user program in the intelligent module 5 is impossiblefrom the CPU module 1. For this reason, if the PLC does not perform anyintended operation upon starting up the system possibly due to someprogram related cause, a plurality of programs must be modified forrespective intelligent modules, thus burdening the user with tediousworks.

On the other hand, if the intelligent module 5 is to be removed from asystem which has a program configuration in such a manner that theintelligent module 5 is dedicated to operations on input/output data,and the CPU module 1 performs subsequent operations using the results ofthe operations performed by the intelligent module 5, the processing sofar performed by the intelligent module 5 must be added to a use programof the CPU module 1. In consideration of time and labor required tomodify associated programs, the system configuration cannot be readilychanged.

In some PLC applications, a local PLC may be linked with a remote PLCutilizing a communication module or the like. In this case, a program ina CPU module of the remote PLC can be modified from the local CPU modulethrough the communication module. However, the intelligent module storesprograms independent of the CPU module, so that if the remote PLC ismounted with some intelligent module, the operator must go to thelocation of the remote PLC for modifying relevant programs stored in theintelligent module.

SUMMARY OF THE INVENTION

It is therefore an object of the present invention to provide aprogrammable controller which facilitates modifications to programsrunning thereon, readily accommodates addition and removal ofintelligent modules contained therein, and offers goodmaintenanceability.

To achieve the above object, the present invention provides aprogrammable controller comprising a CPU module and an input/outputmodule, and adapted to be connectable with an intelligent module,wherein the CPU module includes a user memory and a processing unit, andthe processing unit has a function of determining whether an instructionin an inputted user program should be processed by the CPU module or theintelligent module.

In the programmable controller of the present invention, when theintelligent module is connected to the programmable controller, the CPUmodule is responsive to the processing unit determining that an inputteduser program includes instructions to be executed by the intelligentmodule to transfer a pertinent portion of the user program to theintelligent module such that a processing unit in the intelligent moduleprocesses the portion.

Also, in the programmable controller of the present invention, when nointelligent module is connected to the programmable controller, the CPUmodule is responsive to the processing unit determining that an inputteduser program includes instructions to be executed by the intelligentmodule to process the pertinent portion of the user program.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the configuration of aprogrammable controller (PLC) according to an embodiment of the presentinvention;

FIG. 2 is a block diagram illustrating the configuration of aconventional PLC;

FIG. 3 is a block diagram illustrating the configuration of anintelligent module for use with the PLC according to the embodiment ofFIG. 1;

FIG. 4 is a table showing examples of information stored in a modulestatus register of the PLC according to the embodiment of FIG. 1;

FIG. 5 shows a memory map for a CPU module in the PLC according to theembodiment of FIG. 1;

FIG. 6 is a diagram showing the relationship between the memory map forthe CPU module and a processing flow executed by the CPU module in thePLC according to the embodiment of FIG. 1;

FIG. 7 is a flow diagram illustrating a control flow executed when anintelligent module is mounted in the PLC according to the embodiment ofFIG. 1; and

FIG. 8 is a flow diagram illustrating a control flow executed when nointelligent module is mounted in the PLC according to the embodiment ofFIG. 1.

DETAILED DESCRIPTION OF THE EMBODIMENTS

The present invention will hereinafter be described in conjunction withan embodiment thereof with reference to FIGS. 1 and 3 to 8. FIG. 1 is ablock diagram illustrating the configuration of a programmablecontroller (PLC) according to an embodiment of the present invention.The illustrated PLC, which is generally called a “modular type,” isprovided with modules, individually having different functions, whichare plugged into slots (not shown) of a mother board (not shown) on theback side of the PLC. In this embodiment, the PLC is configured by a CPUmodule 1, an input/output module 4 and an intelligent module 5 connectedto a system bus 9 and a PI/O bus 9′ which provide signal paths on themother board. Generally, the PLC includes one CPU module 1, and one ormore of input/output modules 4 and intelligent modules 5 both asrequired for particular applications.

The CPU module 1 comprises a processing unit 2; a user memory 3; a buscontroller 19; and a PI/O bus controller 16. The processing unit 2, theuser memory 3, the bus controller 19 and the PI/O bus controller 16 areinterconnected through an internal bus 18 of the CPU module 1, so thatthey can communicate data therebetween.

The input/output module 4 comprises an input/output interface 46. Thisinput/output interface 46 is connected to the PI/O bus controller 16 ofthe CPU module 1 through the PI/O bus 9′. The input/output module 4 isgenerally a module having a single function such as an input module oran output module, and is provided with an input interface when itfunctions as an input module and with an output interface when itfunctions as an output module, respectively. In this embodiment, atleast one input module and at least one output module are used incombination. Alternatively, a single module capable of simultaneouslyhandling input and output may be used. In the following description,these modules are collectively called the “input/output module” and the“input/output interface,” respectively.

As illustrated in detail in FIG. 3, the intelligent module 5 comprises aprocessing unit 8; a processing memory 7, an input/output interface 6; amodule status register 14; and a module shared memory 15. The processingunit 8, the processing memory 7 and the input/output interface 6 areinterconnected through an internal bus 59 of the intelligent module 5.The processing memory 7 is connected to the bus controller 19 of the CPUmodule 1 through the system bus 9. The input/output interface 6 isconnected to the PI/O bus controller 16 of the CPU module 1 through thePI/O bus 9′. The input/output interface 6 communicates with peripheraldevices and so on. The processing memory 7 stores a user program. Theprocessing unit 8 runs the user program to perform associatedoperations. The module status register 14 stores information on themounted module. The module shared memory 15 stores input and outputdata, and so on which are shared by other modules.

The intelligent module 5 may be incorporated in the PLC when it isdesired to realize a control which exhibits superior responseperformance. The intelligent module 5 has a unique program systemindependent of programs stored in the CPU module 1, and thereforeperforms operations independent of the CPU module 1, and transmits andreceives data to and from the CPU module 1 through the system bus 9.

When the intelligent module 5 is incorporated into the PLC as a part ofits configuration, the user creates a program to be processed by theintelligent module 5, and stores the created program in the processingmemory 7 within the intelligent module 5. In this embodiment, theprogram is created in a programmer (not shown) adapted for connection tothe CPU module 1, and transferred from the programmer to the CPU 1 forstorage in the user memory 3 within the CPU module 1. Subsequently, theprogram is transferred to the intelligent module 5 and stored in theprocessing memory 7 therein.

In the PLC of this embodiment, the CPU module 1, the input/output module4 and the intelligent module 5 are connected to the system bus 9 and thePI/O bus 9′, so that data can be transmitted and received among oneanother. While the processing unit 2 of the CPU module 1 generallyserves to control input/output and so on in accordance with the userprogram, the intelligent module 5 may also conduct such controlassociated with input/output and so on. Since input/output data isstored in a memory shared by both modules, any data in the memoryrewritten by one module is reflected to the programs of both modules.Since the program of the intelligent module 5 is independent of theprogram of the CPU module 1, the intelligent module 5 can offer acontrol with superior responsibility.

FIGS. 5 and 6 show a memory map for the CPU module 1, and therelationship between this memory map and the operation of the CPU module1 in this embodiment. As shown in FIG. 5, the user memory 3 of the CPUmodule 1 is segmented into an area for storing the contents of themodule status register 14 in the intelligent module 5, and an area forstoring the contents of the module shared memory 15 so as to form amemory map 16, thus implementing a hardware configuration which enablesthe processing unit 2 of the CPU module 1 to write and read into andfrom the user memory 3. FIG. 6 shows the relationship between a sequenceof operations performed by the CPU module 1 when the PLC is mounted withthe intelligent module 5, and the contents stored in the memory mapwhich are accessed during these operations. Since the processing unit 8in the intelligent module 5 has an equivalent configuration to theprocessing unit 2 in the CPU module 1, the intelligent module 5 may becontrolled in a manner similar to the CPU module 1.

As illustrated in FIG. 1, the user memory 3 also stores an instructionbox 11 indicative of instructions executed by the intelligent module 5as the processing assigned to the software on the CPU module 1.Instructions stored in the instruction box 11 are those instructionsconstituting a program 12 which can be executed either by the CPU module1 or by the intelligent module 5, and typically a plurality ofinstructions for performing certain processing (hereinafter called the“common program”). FIG. 1 shows an example of the common program 12stored in the instruction box 11. The form of representation used in theinstruction box 11 handles the contents of processing as one groupcalled a “function block” and is a notation standardized worldwide inIEC1131-3.

There are a wide variety of intelligent modules available, and FIG. 1shows a counter module as one example.

“Slot=n, ch1” written in the instruction box 11 in FIG. 1 indicates achannel 1 in an n^(th) slot (n is a positive integer) formed in thebuses 9, 9′, and refers to instructions executed by the intelligentmodule 5 plugged in the n^(th) slot. Specifically, the instructions inthe instruction box 11 represent specific processing in which an inputpulse is entered in Input1; a count value clear in Input2; and a setvalue in Value1, respectively, and a match output Output1 is outputtedwhen Value2, which is counted up each time an input pulse is entered,matches the set value Value1. While FIG. 1 shows the processing in thecounter module, the contents of the processing performed by the commonprogram 12 stored in the instruction box 11 may be actually determinedby the user at his discretion.

The CPU module 1 determines in software whether or not each instructionin the common program 12 created by the user and stored in theinstruction box 11 should be executed by the intelligent module 5. Thisdetermination is made by previously entering information on a module ormodules, possibly participating in the processing, in the instructionbox 11. If any instruction to be executed by the intelligent module 5 isfound in the user program, the CPU module 1 references a previously readtable in the module status registers of intelligent modules mounted inthe PLC, to determine whether or not the associated intelligent module 5is plugged in a specified slot. If the intelligent module 5 is pluggedin the slot, the common program 12 is transferred to the intelligentmodule 5, while the CPU module 1 monitors input and output with theintelligent module 5 instead of executing the common program 12. If theintelligent module 5 is not plugged in the slot, the CPU module 1 hasthe processing unit 2 run the common program 12.

The intelligent module 5, on the other hand, has a hardwareconfiguration for storing the common program 12 transferred thereto fromthe CPU module 1 in the processing memory 7, and software forcontrolling the hardware configuration. In the intelligent module 5, theprocessing executed by the processing unit 8 to read the common program12 stored in the processing memory 7 and run the same is performed in amanner similar to the processing executed by the processing unit 2 ofthe CPU module 1 to read the common program stored in the user memory 3and execute the same. Therefore, the processing unit 8 of theintelligent module 5 can be controlled in the same manner as theprocessing unit 2 of the CPU module 1, and the common program 12 storedin the instruction box 11 may be processed either by the intelligentmodule 5 or by the CPU module 1.

In this embodiment, since the intelligent module 5 and the CPU module 1are configured as described above, a common program executed by theintelligent module 5 may be stored in the user memory 3 of the CPUmodule 1 such that the CPU module 1 collectively manages commonprograms. The CPU module 1 can discriminate the type of a particularmodule mounted therein by reading the module status register 14 of themodule. In this embodiment, the CPU module 1 may discriminate eachmodule in the following manner.

The module status register 14 has binary information comprised ofseveral bits, which is unique to each type, so that the CPU module 1discriminates the type of module in accordance with a patternrepresented by the binary information. FIG. 4 shows examples of such bitpatterns when the binary information is comprised of four bits.

FIG. 4 shows an example of the binary information indicative of an inputmodule, an output module and an intelligent module. Binary information“0001” is stored for an input module in the module status register 14;“0010” for an output module; and “1100” for an intelligent module,respectively. In this event, when the CPU module 1 reads information“1100” from the status register 14, the CPU module 1 determines that theassociated module is an intelligent module.

This method allows the user to manage only programs stored in the CPUmodule 1, thereby eliminating a tedious work which would otherwise berequired in the prior art to modify programs. Also, since the userprogram is handled irrespective of the presence or absence of theintelligent module 5, the intelligent module 5 can be readily removedfrom the PLC system.

Next, the operation of the PLC when it is mounted with the intelligentmodule 5 will be described with reference to FIGS. 6 to 8. FIG. 6 showsthe relationship between the memory map and the operation of the PLC,and FIGS. 7, 8 are flow diagrams illustrating the operation of the PLCwhen it is mounted with the intelligent module 5 and when it is notmounted with the intelligent module 5, respectively. First, theoperation of the PLC when mounted with the intelligent module isdescribed with reference to FIG. 7. The user creates a control programin a peripheral device (programmer), and transfers the created controlprogram to the CPU module 1 (001). The CPU module 1 writes thetransferred user program into the user memory 3 (002), and subsequentlyreads information on mounted I/O devices from the module status register14 (003) to confirm whether or not the intelligent module 5 is mountedin the PLC. When the CPU module 1 determines that the intelligent module5 is mounted (004), the CPU module 1 transfers a portion of the userprogram executed by the intelligent module 5 (common program 12) to theintelligent module 5 (005). As the common program 12 transferred to theintelligent module 5 has been written into the processing memory 7 (006)to allow the user to start operating (007), the CPU module 1 operates inaccordance with the program held in the user memory 3. The CPU module 1instructs the intelligent module 5 to start processing (008) when aprogram execution start condition for the intelligent module 5 isestablished in the CPU module 1 during the operation (100)(corresponding to a joint (100) connected to the instruction box 11 inFIG. 1). The intelligent module 5 executes the processing in accordancewith the program previously transferred from the CPU module 1 (009), andreturns the result to the CPU module 1 (010). The intelligent module 5may return the result to the CPU module 1 several times depending on thecontents of the processing.

Next, the operation of the PLC when it is not mounted with theintelligent module 5 will be described with reference to FIG. 8. Theuser creates a control program in a peripheral device, and transfers thecreated program to the CPU module (001). The CPU module 1 writes thetransferred user program into the user memory 3 (002), and readsinformation on mounted I/O devices (003). If the information indicatesthat no intelligent module 5 is mounted (130), the CPU module 1 does nottransfer a common program 12 included in the user program to theintelligent module 5. Subsequently, as the user starts operating (007),the CPU module 1 operates in accordance with the program held in theuser memory 3. When an execution condition for the common program 12 isestablished during the operation of the CPU module 1 (100), the CPUmodule 1 executes processing in accordance with the common program 12instead of the intelligent module (131).

According to this embodiment, even when the PLC is mounted with aplurality of intelligent modules 5, the CPU module 1 can manage theoperation of all the intelligent modules 5 only by modifying thecontents of the user memory 3. Also, when no intelligent module ismounted, the CPU module 1 can process a program associated with anintelligent module even without modifying the contents of the usermemory 3, thereby significantly improving the operability.

Further, when the PLC of this embodiment is applied to a system in whicha local PLC is linked to a PLC located at a remote site (hereinaftercalled the “remote PLC”) through a communication module or the like foruse in a network environment, programs associated with a CPU module andan intelligent module or modules within the remote PLC can be managedonly by manipulating a user memory in the CPU module within the remotePLC. It is therefore possible to change the operation of an intelligentmodule in the remote PLC by modifying a program in the CPU module withinthe remote PLC from a CPU module within the local PLC through thecommunication module.

As described above in detail, the present invention provides aprogrammable controller which facilitates modifications to programsrunning thereon, readily accommodates addition and removal ofintelligent modules contained therein, and offers goodmaintenanceability.

What is claimed is:
 1. A programmable controller comprising: a CPUmodule; and an input/output module, wherein each module is adapted to beconnectable with an intelligent module, wherein said intelligent moduleis detachable, and equipped with a processing unit operableasynchronously with said CPU module for enabling unique operation ofsaid intelligent module, wherein said CPU module includes a user memoryand a processing unit, said processing unit included in said CPU modulehaving a function of determining whether an instruction in an input userprogram should be processed by said CPU module or said intelligentmodule, and wherein when said intelligent module is connected to saidprogrammable controller, said CPU module is responsive to adetermination of said processing unit included in said CPU module thatthe input user program includes instructions to be executed by saidintelligent module to transfer a pertinent portion of said user programto said intelligent module such that said processing unit included insaid intelligent module processes said user program.
 2. A programmablecontroller according to claim 1, wherein when said intelligent module isnot connected to said programmable controller, said CPU module isresponsive to determination of said processing unit that the inputteduser program includes instructions to be executed by said intelligentmodule to process said pertinent portion of said user program.